package com.huaxin.dss2.ws;

import javax.jws.WebService;
import javax.xml.ws.Endpoint;

/**
 * Created by likai on 2017/9/19.
 */
@WebService
public class WS {

    public  String getValue(String name){
        System.out.print("conneted");
        return "hehe"+name;
    }

    public static Boolean setMonitorValue(String dataVode,String value) {

        return true;
    }
//    public boolean setConfigMap(String id, Object ob) {
//        System.out.println("--->开始远控code----->");
//        System.out.println("--->id-->" + SN + "   String----->" + (String) o);
//        boolean flag = false;
//        JSONObject jso = JSON.parseObject((String) o);
//        JSONArray jsarr = jso.getJSONArray("RemoteControl");
//        JSONObject ao = jsarr.getJSONObject(0);
//        String vString = ao.getString("tag");
//        String[] tags = vString.split(",");
//        MonitorModel monitorModel=new MonitorModel();
//        monitorModel.setMonitorUid(tags[1]);
//        monitorModel.setMonitorValue(ao.getString("value"));
//        monitorModel.setBoxNo(SN);
//        monitorModel.setType("0");
//        Boolean result = SignalRConnectUtil.setMonitorValue(monitorModel);
//        return result;
//    }
    //public static  void main(String[] args){
      //  Endpoint.publish("http://localhost:9000/WS",new WS());
      //  System.out.print("service success!");
   // }

//    public static Boolean setMonitorValue(MonitorModel monitorModel) {
//        try {
//            System.out.println("begin fmodify-----");
//            DataDao dataDao = SpringUtils.getBean(DataDao.class);
//            String boxNo = dataDao.findBoxSeriesNum(monitorModel.getBoxNo());
//            CustomDataType customDataType = SpringUtils.getBean(PropertiesUtil.getString("iBox.project.type"));
//            customDataType.constructMonitorUid(monitorModel);
//            customDataType.dealMonitorValue(monitorModel, boxNo);
//            String setMonitorUrl = PropertiesUtil.getString("modifyBoxIndexValueUrl") + boxNo;
//            MonitorJsonModel monitorJsonModel = new MonitorJsonModel();
//            monitorJsonModel.setType(monitorModel.getType());
//            monitorJsonModel.setName(monitorModel.getMonitorUid());
//            monitorJsonModel.setValue(monitorModel.getMonitorValue());
//            String result = NewSignalR.commServer.executePost(setMonitorUrl, monitorJsonModel, String.class);
//            System.out.println("修改成功");
//            return true;
//        } catch (Exception e) {
//            BoxServerResponseException boxServerResponseException = (BoxServerResponseException) e;
//            System.out.println("错误消息1：" + boxServerResponseException.getMessage());
//            System.out.println("错误编码1：" + boxServerResponseException.errCode);
//        }
//        return false;
//    }
}
